<?php
	require 'Pagination.php';
	$page = empty($_GET['page']) ? 1 : $_GET['page'];//当前页
	$total = 100;//总页数
	$paginationObj = new Pagination($page, $total);
	$pageHTML = $paginationObj->show();

	$paginationObj2 = new Pagination($page, $total);
	$paginationObj2->showPageCount = 7;
	$paginationObj2->prepend = '<li class=""><a href="#">前边插入一个链接</a></li>';
	$paginationObj2->append = '<li class=""><a href="#">后边边插入一个链接</a></li>';
	$pageHTML2 = $paginationObj2->show();

	$paginationObj3 = new Pagination($page, $total);
	$paginationObj3->append = '<li class=""><a href="#">返回列表</a></li>';
	$paginationObj3->addHref = FALSE;
	$paginationObj3->mainClass = 'pagination ajax';
	$pageHTML3 = $paginationObj3->show();
?>


<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Bootstrap 3 的多级下拉菜单示例</title>
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    <link rel="stylesheet" href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css"/>
    <script type="text/javascript" src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
    <style>
    .ajax li{cursor: pointer;}
    </style>
</head>
<body>
<div class="container">
    <div class="row">
    	<h1 class="page-header text-center">分页类DEMO</h1>
        <div class="col-md-12">
            <form class="form-inline" method="get" action="">
			  <div class="form-group">
			    <label class="sr-only">Email</label>
			    <p class="form-control-static">输入关键字</p>
			  </div>
			  <div class="form-group">
			    <label for="inputPassword2" class="sr-only">Password</label>
			    <input type="text" class="form-control" name="keyword" value="<?php echo !empty($_GET['keyword']) ? $_GET['keyword'] : ''?>">
			  </div>
			  <button type="submit" class="btn btn-default">给我搜</button>
			</form>
			<h3>默认样式：最多显示10页</h3>
			<?php echo $pageHTML ?>
			<h3>自定义样式：最多显示7页，两端插入一个链接</h3>
			<?php echo $pageHTML2 ?>
			<h3>自定义样式：用于ajax，a链接上不加href，ul类名改为'pagination ajax'</h3>
			<?php echo $pageHTML3 ?>
        </div>  
    </div>

    
</div>

</body>
</html>